<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org">

  <title>C++ Containers</title>
  <link href="cppreference.css" rel="stylesheet" type="text/css">
</head>

<body>
<table>
  <tr>
  <td>
  <div class="body-content">

  <div class="header-box">
    <a href="index.html">cppreference.com</a> &gt; Containers
  </div>

  <h1>C++ Containers</h1>The C++ Containers (vectors, lists, etc.) are
  generic vessels capable of holding many different types of data. For
  example, the following statement creates a <a href=
  "cppvector/index.html">vector</a> of integers:
  <pre>
vector&lt;int&gt; v;
</pre>Containers can hold standard objects (like the
<strong>int</strong> in the above example) as well as custom objects,
as long as the objects in the container meet a few requirements:

  <ul>
    <li>The object must have a default constructor,</li>

    <li>an accessible destructor, and</li>

    <li>an accessible assignment operator.</li>
  </ul>When describing the functions associated with these various
  containers, this website defines the word <strong>TYPE</strong> to be
  the object type that the container holds. For example, in the above
  statement, <strong>TYPE</strong> would be <strong>int</strong>.
  Similarily, when referring to containers associated with pairs of
  data (<a href="cppmap/index.html">map</a> for example)
  <strong>key_type</strong> and <strong>value_type</strong> are used to
  refer to the key and value types for that container.
  </div>
  </td>
  


  </tr>
  </table>
</body></html>
